<%--
  Created by IntelliJ IDEA.
  User: 我是你爸爸
  Date: 2021/4/11
  Time: 13:49
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title><%= getServletConfig().getServletContext().getInitParameter("projectName")%>文件上传</title>
    <script src="<%= request.getContextPath()%>/js/layui-v2.6.7/layui/layui.js"></script>
    <script src="<%= request.getContextPath()%>/js/jQuery.js"></script>
</head>
<link rel="stylesheet" href="<%= request.getContextPath()%>/css/upload.css">
<script src="<%= request.getContextPath()%>/js/layui-v2.6.7/layui/layui.js"></script>
<body style="margin: 0">
<a href="<%=request.getContextPath()%>/ces.jsp">返回首页</a>
<div id="update"
     style="text-align: center; position: relative;top:20% ;box-shadow: gray 0px 0px 10px;padding: 30px;width: 300px;height: 400px">
    <h1>菜品发布</h1>
    <form action="<%= request.getContextPath()%>/upload" method="post" enctype="multipart/form-data">
        <div style="text-align: left;">
            <input type="text" placeholder="请输入菜谱名称" class="up" name="name" onblur="if($(this).val()==''){alert('菜谱名称不能为空！')}">
            <br>
            <input type="text" placeholder="请输入菜谱简介" name="introduce" onblur="if($(this).val()==''){alert('菜谱简介不能留空！')}">

            <br>
            <input type="file" placeholder="菜品示例图" name="img" style="line-height: 50px">
            <SELECT name="type" >
                <OPTION VALUE="家常菜">家常菜 </OPTION>
                <OPTION VALUE="凉菜">凉菜 </OPTION>
                <OPTION VALUE="面食">面食 </OPTION>
                <OPTION VALUE="蔬菜">蔬菜 </OPTION>
                <OPTION VALUE="时令菜">时令菜 </OPTION>
                <OPTION VALUE="特色小吃">水果 </OPTION>
                <OPTION VALUE="烧烤">烧烤 </OPTION>
                <OPTION VALUE="饮料甜品">饮料甜品 </OPTION>
                <OPTION VALUE="肉食">肉食 </OPTION>
                <OPTION VALUE="素食">素食</OPTION>
                <OPTION VALUE="汤">汤 </OPTION>
            </SELECT>
            <input type="text" placeholder="请输入菜谱详情" name="details">
            <br>
            <button type="submit"
                    style="position:relative; width: 100px;height: 40px;position: absolute;bottom: 10%;left: 36%;" onclick="up()">上传
            </button>
        </div>
    </form>

</div>
<%@include file="currency/base.jsp" %>
</body>
<script>
    function up() {
        if ($(".up").value==''){
            alert("菜单名不能为空！")
        }

    }
</script>
</html>
